//ksdfjkahjkl
//File: MainTester.cpp
//Author: Ethan Tadlock
//Desc.: Implementation of the main module
//Updated: 3/27ajfhdjkalsd

#include "Intersection.h"
#include "DrivingLane.h"
#include "StopLight.h"
#include <iostream>
#include <cstdlib>
//hifdafASDFAasdf
using namespace std;

int Intersection::getNumberOfDrivers()
{
	totalInInter = North.getNumberOfDriversInLane() + South.getNumberOfDriversInLane() + Turn.getNumberOfDriversInLane() + Exit.getNumberOfDriversInLane();
	return(totalInInter);
}

bool Intersection::isEmpty(int totalInInter)
{
	if(North.getNumberOfDriversInLane() + South.getNumberOfDriversInLane() + Turn.getNumberOfDriversInLane() + Exit.getNumberOfDriversInLane() == 0){
		return false;
	}else{
		return true;
	}
}

void Intersection::northAddDriver(){
	North.addDriver();
}
void Intersection::southAddDriver(){
	South.addDriver();
}
void Intersection::turnAddDriver(){
	Turn.addDriver();
}
void Intersection::exitAddDriver(){
	Exit.addDriver();
}

void Intersection::northRemoveDriver(){
	North.exitLane();
}
void Intersection::southRemoveDriver(){
	South.exitLane();
}
void Intersection::turnRemoveDriver(){
	Turn.exitLane();
}
void Intersection::exitRemoveDriver(){
	Exit.exitLane();
}

int Intersection::getNorthNumberOfDrivers(){
	return North.getNumberOfDriversInLane();
}
int Intersection::getSouthNumberOfDrivers(){
	return South.getNumberOfDriversInLane();
}
int Intersection::getTurnNumberOfDrivers(){
	return Turn.getNumberOfDriversInLane();
}
int Intersection::getExitNumberOfDrivers(){
	return Exit.getNumberOfDriversInLane();
}

void Intersection::northChangeMode(int mode){
	North.changeMode(mode);
}
void Intersection::southChangeMode(int mode){
	South.changeMode(mode);
}
void Intersection::turnChangeMode(int mode){
	Turn.changeMode(mode);
}
void Intersection::exitChangeMode(int mode){
	Exit.changeMode(mode);
}

int Intersection::getNorthMode(){
	return North.getMode();
}
int Intersection::getSouthMode(){
	return South.getMode();
}
int Intersection::getTurnMode(){
	return Turn.getMode();
}
int Intersection::getExitMode(){
	return Exit.getMode();
}